<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>根据元素的类名获得元素</title>
</head>
<body>
  <div class="container">作者是个大帅哥</div>
  <script>
    //获取文档流中所有的元素
    var ele = document.getElementsByClassName('container');
    console.log(ele);
  </script>
</body>
</html>